<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>原型中的constructor属性</title>
  </head>
  <body></body>
  <script>
    function User(name) {
      this.name = name;
    }

    // User.prototype.show = function() {
    //   console.log(this.name);
    // };

    User.prototype = {
      constructor: User,
      show() {
        console.log(this.name);
      }
    };

    console.dir(User);
    console.log(User.prototype.constructor == User);
    let lisi = new User.prototype.constructor("李四");
    lisi.show();
  </script>
</html>
